﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:CoreGallery_Core_UI="clr-namespace:CoreGallery.Core.UI" 
    x:Class="CoreGallery.Core.UI.AddinManagerWindow" 
    Title="Core Gallery Addins" Height="600" Width="480" Icon="/CoreGallery.Core;component/images/CoreGallery-logo.gif" AllowsTransparency="False" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:CoreGallery_Core="clr-namespace:CoreGallery.Core" xmlns:System="clr-namespace:System;assembly=mscorlib" >

	<Window.Resources>
		<DataTemplate x:Key="AddinItemDataTemplate">
			<CoreGallery_Core_UI:AddinItemUserControl/>
		</DataTemplate>
		<ItemsPanelTemplate x:Key="CoreItemsPanelTemplate">
			<VirtualizingStackPanel IsItemsHost="True"/>
		</ItemsPanelTemplate>
		<SolidColorBrush x:Key="ListBorder" Color="#828790"/>
		<Style x:Key="ListBoxStyleAddins" TargetType="{x:Type ListBox}">
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBox}">
						<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
							<ScrollViewer Padding="{TemplateBinding Padding}" x:Name="ScrollViewerAddins" Focusable="false">
								<ItemsPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
							</ScrollViewer>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							</Trigger>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>

    <DockPanel LastChildFill="True">
        <Border HorizontalAlignment="Stretch" x:Name="ModeToolbar" Width="Auto" Height="60" DockPanel.Dock="Top" BorderBrush="#FF000000" BorderThickness="0,0,0,2" CornerRadius="0.1,0.1,0.1,0.1">
            <StackPanel Width="Auto" Height="Auto" Orientation="Horizontal" x:Name="AddinsToolbar">
                <Button BorderThickness="0,0,0,0" Width="{Binding ActualHeight, ElementName=AddinsToolbar}" Height="Auto" Content="Importers" VerticalAlignment="Stretch" x:Name="ImportersButton" Click="ImportersButton_Click" />
                <Button BorderThickness="0,0,0,0" Width="{Binding ActualHeight, ElementName=AddinsToolbar}" Height="Auto" Content="Exporters" VerticalAlignment="Stretch" x:Name="ExportersButton" Click="ExportersButton_Click" />
                <Button BorderThickness="0,0,0,0" Width="{Binding ActualHeight, ElementName=AddinsToolbar}" Height="Auto" Content="Transforms" VerticalAlignment="Stretch" x:Name="TransformersButton" Click="TransformersButton_Click" />
                <Button BorderThickness="0,0,0,0" Width="{Binding ActualHeight, ElementName=AddinsToolbar}" Height="Auto" Content="Services" VerticalAlignment="Stretch" x:Name="ServicesButton" Click="ServicesButton_Click" />
                <Button BorderThickness="0,0,0,0" Width="{Binding ActualHeight, ElementName=AddinsToolbar}" Height="Auto" Content="Storage" VerticalAlignment="Stretch" x:Name="StorageButton" Click="StorageButton_Click" />
            </StackPanel>
        </Border>
        <Border x:Name="ActionToolbar" Width="Auto" Height="50" Padding="5"  DockPanel.Dock="Bottom" BorderThickness="0,0,0,0" CornerRadius="0.1,0.1,0.1,0.1" Background="LightGray">
            <WrapPanel Margin="5,0,5,0" VerticalAlignment="Center" Width="Auto" Height="Auto">
                <Button x:Name="ButtonFindUpdates" Width="80" Height="Auto" Content="Find Updates" Click="ButtonFindUpdates_Click" />
            </WrapPanel>
        </Border>
        <Border Padding="5" Background="LightGray">
            <ListBox x:Name="AddinsListBox" IsSynchronizedWithCurrentItem="True" HorizontalAlignment="Stretch" Margin="5" VerticalAlignment="Stretch" Width="Auto" Height="Auto" ItemTemplate="{DynamicResource AddinItemDataTemplate}" Style="{DynamicResource ListBoxStyleAddins}" ItemsPanel="{DynamicResource CoreItemsPanelTemplate}"/>
        </Border>
    </DockPanel>
</Window>
